#include<iostream>
using namespace std;

int inArrLen=10,count=0,res[100][10],used[10];

void print(int i){
   for (int j = 0; j < inArrLen;j++)printf("%3d",res[i][j]);
    puts("");
}

int dfs(int rank,int cur,int num){
    if (inArrLen-cur < num-rank){
        return 0;
    }
    if(rank == num) {
        return 1;
        }
    for (int i = cur+1; i <inArrLen ; i++)
    {
        res[count][rank] = i;
        count += dfs(rank+1,i,num);
    }
    return 0;
}

int main(){
    dfs(0,0,5);
    for (int i = 0; i < count; i++)
    {
        print(i);
    }
    
}